package com.guo.core.framework.template.complex;

import com.guo.core.framework.template.AbstractExecuteService;
import com.guo.core.framework.template.TestReq;
import com.guo.core.framework.template.TestRsp;

public abstract class ExecuteServiceTemplate extends AbstractExecuteService<TestReq, TestRsp> {

    @Override
    public TestRsp execute(TestReq testReq) {
        this.before(testReq);
        TestRsp testRsp = this.post(testReq);
        this.after(testReq, testRsp);
        return testRsp;
    }

    protected abstract void after(TestReq testReq, TestRsp testRsp);

    protected abstract TestRsp post(TestReq testReq);

    protected abstract void before(TestReq testReq);

}
